package com.itheima.mapper;

import com.itheima.entity.Emp;
import com.itheima.entity.EmpQueryParam;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;


import java.util.List;

/**
 * @Description EmpMapper
 * @Author 你的名字拼接或昵称
 * @Date 2025-09-03
 */
@Mapper
public interface EmpMapper {

//@Select("select e.*,d.name deptName from emp e left join dept d on e.dept_id=d.id")
    List<Emp> list(EmpQueryParam param);

//
    void insert(Emp emp);

    void deleteBatch(List<Integer> ids);

    @Select("select* from emp where id=#{id}")
    Emp getById(Integer id);


    void update(Emp emp);

    @Select("select *from emp")
    List<Emp> getlist();

    @Select("select *from emp where username=#{username} and password=#{password}")
    Emp getUsernameAndPassword(Emp emp);
}
